﻿@model GaclibWebPage.Models.DemoPageModel

@{
    ViewBag.Title = "GacLib - Demos";
}

<tr>
    <td align="left" valign="top" colspan="6">
        <h1>How to download demos</h1>
        <p>
            Source codes for the following demos are available. If you want to download these demos, modify and compile by yourself, please read the <a href="@Url.Action("Download")#Demos">DOWNLOAD</a> page.
        </p>
        <h1>Demo Index</h1>
        @foreach (var category in Model.DemoCategories)
        {
            <ul>
            <li><strong><a href="#@category.Name">@category.Name</a></strong>: @category.Description</li>
            </ul>
        }
        @foreach (var category in Model.DemoCategories)
        {
            <h1><a name="#@category.Name">@category.Name</a></h1>
            <table class="DemoTable" cellspacing="2" >
                @for (int i = 0; i < category.Demos.Length; i++)
                {
                    var demo = category.Demos[i];
                    if (i % 3 == 0)
                    {
                        @:<tr>
                    }
                    <td>
                        <a class="DemoLink" href="@Url.Action("ShowDemo", "DemoPage", new { demoId = demo.Name })" >
                            <div class="DemoTitle">
                                @demo.Title
                            </div>
                            <div class="DemoImage">
                                <img src="@Url.Content(string.Format("~/Content/Demos/Demos.{0}.jpg", demo.Name))" />
                            </div>
                        </a>
                    </td>
                    if (i % 3 == 2 || i == category.Demos.Length - 1)
                    {
                        @:</tr>
                    }
                }
            </table>
        }
    </td>
</tr>